<?php

if (!isset($_SESSION['logged']) || $_SESSION['level'] != "admin")
    print "<script language='javascript'>
        window.location.href='./?url=404';
        </script>";
else {
    $title = $_POST['title'];

    $sql = "INSERT INTO `type` (`title`) VALUES ('$title');";
    $result = mysql_query($sql, $link);
    
    print "<script language='javascript'>
        window.location.href='./';
        </script>";
}
?>
